﻿using System.Collections.Generic;
using BSDS.Commands.Commands.Implementation.Jobs;
using BSDS.Core.Model.Services.Jobs;

namespace BSDS.Commands.Commands.Creation.Implementation.Jobs
{
    public class CheckJobCommandCreator : CommandCreatorBase
    {
        private readonly JobService jobService;

        public CheckJobCommandCreator(JobService jobService)
        {
            this.jobService = jobService;
        }

        protected override bool Supports(Dictionary<string, string> parameters)
        {
            return parameters.Keys.Count == 1 && parameters.ContainsKey("checkjob");
        }

        protected override ICommand Create(Dictionary<string, string> parameters)
        {
            var jobId = parameters["checkjob"];

            return new CheckJobCommand(jobId, jobService);
        }
    }
}